3.6.55 \(\int \frac {A+B x}{x (a^2+2 a b x+b^2 x^2)} \, dx\)

Optimal. Leaf size=42 \[ -\frac {A \log (a+b x)}{a^2}+\frac {A \log (x)}{a^2}+\frac {A b-a B}{a b (a+b x)} \]

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {27, 77} \begin {gather*} -\frac {A \log (a+b x)}{a^2}+\frac {A \log (x)}{a^2}+\frac {A b-a B}{a b (a+b x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(A + B*x)/(x*(a^2 + 2*a*b*x + b^2*x^2)),x]

[Out]

(A*b - a*B)/(a*b*(a + b*x)) + (A*Log[x])/a^2 - (A*Log[a + b*x])/a^2

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin {align*} \int \frac {A+B x}{x \left (a^2+2 a b x+b^2 x^2\right )} \, dx &=\int \frac {A+B x}{x (a+b x)^2} \, dx\\ &=\int \left (\frac {A}{a^2 x}+\frac {-A b+a B}{a (a+b x)^2}-\frac {A b}{a^2 (a+b x)}\right ) \, dx\\ &=\frac {A b-a B}{a b (a+b x)}+\frac {A \log (x)}{a^2}-\frac {A \log (a+b x)}{a^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 38, normalized size = 0.90 \begin {gather*} \frac {\frac {a (A b-a B)}{b (a+b x)}-A \log (a+b x)+A \log (x)}{a^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(A + B*x)/(x*(a^2 + 2*a*b*x + b^2*x^2)),x]

[Out]

((a*(A*b - a*B))/(b*(a + b*x)) + A*Log[x] - A*Log[a + b*x])/a^2

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A+B x}{x \left (a^2+2 a b x+b^2 x^2\right )} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(A + B*x)/(x*(a^2 + 2*a*b*x + b^2*x^2)),x]

[Out]

IntegrateAlgebraic[(A + B*x)/(x*(a^2 + 2*a*b*x + b^2*x^2)), x]

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 62, normalized size = 1.48 \begin {gather*} -\frac {B a^{2} - A a b + {\left (A b^{2} x + A a b\right )} \log \left (b x + a\right ) - {\left (A b^{2} x + A a b\right )} \log \relax (x)}{a^{2} b^{2} x + a^{3} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x/(b^2*x^2+2*a*b*x+a^2),x, algorithm="fricas")

[Out]

-(B*a^2 - A*a*b + (A*b^2*x + A*a*b)*log(b*x + a) - (A*b^2*x + A*a*b)*log(x))/(a^2*b^2*x + a^3*b)

________________________________________________________________________________________

giac [A]  time = 0.15, size = 48, normalized size = 1.14 \begin {gather*} -\frac {A \log \left ({\left | b x + a \right |}\right )}{a^{2}} + \frac {A \log \left ({\left | x \right |}\right )}{a^{2}} - \frac {B a^{2} - A a b}{{\left (b x + a\right )} a^{2} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x/(b^2*x^2+2*a*b*x+a^2),x, algorithm="giac")

[Out]

-A*log(abs(b*x + a))/a^2 + A*log(abs(x))/a^2 - (B*a^2 - A*a*b)/((b*x + a)*a^2*b)

________________________________________________________________________________________

maple [A]  time = 0.06, size = 46, normalized size = 1.10 \begin {gather*} \frac {A}{\left (b x +a \right ) a}+\frac {A \ln \relax (x )}{a^{2}}-\frac {A \ln \left (b x +a \right )}{a^{2}}-\frac {B}{\left (b x +a \right ) b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)/x/(b^2*x^2+2*a*b*x+a^2),x)

[Out]

1/a/(b*x+a)*A-1/b/(b*x+a)*B-A*ln(b*x+a)/a^2+A/a^2*ln(x)

________________________________________________________________________________________

maxima [A]  time = 0.61, size = 44, normalized size = 1.05 \begin {gather*} -\frac {B a - A b}{a b^{2} x + a^{2} b} - \frac {A \log \left (b x + a\right )}{a^{2}} + \frac {A \log \relax (x)}{a^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x/(b^2*x^2+2*a*b*x+a^2),x, algorithm="maxima")

[Out]

-(B*a - A*b)/(a*b^2*x + a^2*b) - A*log(b*x + a)/a^2 + A*log(x)/a^2

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 39, normalized size = 0.93 \begin {gather*} \frac {A\,b-B\,a}{a\,b\,\left (a+b\,x\right )}-\frac {2\,A\,\mathrm {atanh}\left (\frac {2\,b\,x}{a}+1\right )}{a^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*x)/(x*(a^2 + b^2*x^2 + 2*a*b*x)),x)

[Out]

(A*b - B*a)/(a*b*(a + b*x)) - (2*A*atanh((2*b*x)/a + 1))/a^2

________________________________________________________________________________________

sympy [A]  time = 0.29, size = 32, normalized size = 0.76 \begin {gather*} \frac {A \left (\log {\relax (x )} - \log {\left (\frac {a}{b} + x \right )}\right )}{a^{2}} + \frac {A b - B a}{a^{2} b + a b^{2} x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x/(b**2*x**2+2*a*b*x+a**2),x)

[Out]

A*(log(x) - log(a/b + x))/a**2 + (A*b - B*a)/(a**2*b + a*b**2*x)

________________________________________________________________________________________